<?php

class HtmlComponent {

	public static function select($label, $length, $name, $options, $id='', $note="&nbsp;" ) {
	
		$select = new View("_components/jquery_select");
		$select->set("jquery_select.label", $label);
		$select->set("jquery_select.note", $note);
		$select->set("jquery_select.length", $length);
		$select->set("jquery_select.name", $name);
		$select->set("jquery_select.id", ($id != '' ? 'id="'.$id.'"' : '' ));
		$select->set("jquery_select.options", ViewList::merge("option", $options));
		
		return $select->output();
		
	}
	
	public static function inputText($label, $length, $name, $value, $disabled=false) {
		
		$inputText = new View("_components/jquery_input");
		$inputText->set("jquery_input_text.style", "");
		$inputText->set("jquery_input_text.type", "text");
		$inputText->set("jquery_input_text.label", $label);
		$inputText->set("jquery_input_text.length", $length); // small, medium or large
		$inputText->set("jquery_input_text.name", $name);
		$inputText->set("jquery_input_text.value", $value);
		$inputText->set("jquery_input_text.disabled", ($disabled ? "disabled" : "" ));
		
		return $inputText->output();
		
	}
	
	public static function inputHidden($label, $length, $name, $value, $disabled=false) {
		
		$inputText = new View("_components/jquery_input");
		$inputText->set("jquery_input_text.style", "style='display: none;'");
		$inputText->set("jquery_input_text.type", "hidden");
		$inputText->set("jquery_input_text.label", $label);
		$inputText->set("jquery_input_text.length", $length); // small, medium or large
		$inputText->set("jquery_input_text.name", $name);
		$inputText->set("jquery_input_text.value", $value);
		$inputText->set("jquery_input_text.disabled", ($disabled ? "disabled" : "" ));
		
		return $inputText->output();
		
	}
	
}

?>